﻿using csharp_movies_415.Data;
using csharp_movies_415.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace csharp_movies_415.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            using (MoviesDbContext mDb = new MoviesDbContext()) {
                MovieIndexVm mVm = new MovieIndexVm();
                mVm.Greeting = "Hello from the Home Controller";
                mVm.MovieList = mDb.MyMovies.ToList();

                return View(mVm);
            };
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}